//
//  cityDefault.m
//  WuyouTang
//
//  Created by 王敏欣 on 2016/12/13.
//  Copyright © 2016年 cat. All rights reserved.
//
#import "CityDefault.h"
NSString *const  mycity = @"locationCity";
NSString *const  mylng = @"lng";
NSString *const  mylat = @"lat";
@implementation CityDefault

#pragma mark - 定位城市
+(void)saveLocationCity:(NSString *)save {
    NSUserDefaults *userDefaults = [[NSUserDefaults alloc]init ];
    [userDefaults setObject:save forKey:mycity];
    [userDefaults synchronize];
}
+(NSString *)getLocationCity {
    NSUserDefaults *userDefaults = [[NSUserDefaults alloc]init ];
    NSString *getStr = [userDefaults objectForKey:mycity];
    return getStr;
}

#pragma mark - 定位经度
+(void)saveLocationLng:(NSString *)save {
    NSUserDefaults *userDefaults = [[NSUserDefaults alloc]init ];
    [userDefaults setObject:save forKey:mylng];
    [userDefaults synchronize];
}
+(NSString *)getLocationLng {
    NSUserDefaults *userDefaults = [[NSUserDefaults alloc]init ];
    NSString *getStr = [userDefaults objectForKey:mylng];
    return getStr;
}

#pragma mark - 定位纬度
+(void)saveLocationLat:(NSString *)save {
    NSUserDefaults *userDefaults = [[NSUserDefaults alloc]init ];
    [userDefaults setObject:save forKey:mylat];
    [userDefaults synchronize];
}
+(NSString *)getLocationLat {
    NSUserDefaults *userDefaults = [[NSUserDefaults alloc]init ];
    NSString *getStr = [userDefaults objectForKey:mylat];
    return getStr;
}
/// 国家代号
+(void)saveGdyCountry:(NSString *)save; {
    NSUserDefaults *userDefaults = [[NSUserDefaults alloc]init ];
    [userDefaults setObject:save forKey:@"gdy_country_code"];
    [userDefaults synchronize];
}
+(NSString *)getGdyCountry;{
    NSUserDefaults *userDefaults = [[NSUserDefaults alloc]init ];
    NSString *getStr = @"";
    if ([userDefaults objectForKey:@"gdy_country_code"]) {
        getStr = [userDefaults objectForKey:@"gdy_country_code"];
    }
    return getStr;
}

@end
